#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
@Project ：图灵学习 
@File    ：12.读写行.py
@IDE     ：PyCharm 
@Author  ：ChenLiGao
@Date    ：2024-10-30 16:48
'''
# 1.定义文件路径
file_path = '测试文件.txt'

stu_name_list = ["双双", "\n安娜", "\n夏洛"]
file_obj = open(file_path, mode="w", encoding="utf-8")

# 多行写
file_obj.writelines(stu_name_list)